<script>
	import Vue from 'vue'
	export default {
		onLaunch: function() {
			// 获取系统信息 配置常量
			uni.getSystemInfo({
				success: function(res) {
					//自定义导航栏高度
					var CustomBarHeight;
					//非小程序 APP or H5
					// #ifndef MP
					if (res.platform == "android") {
						CustomBarHeight = res.statusBarHeight + 50;
					} else {
						CustomBarHeight = res.statusBarHeight + 45;
					};
					// #endif

					//腾讯系 微信 or 小程序
					// #ifdef MP-WEIXIN || MP-QQ
					let capsule = wx.getMenuButtonBoundingClientRect();
					if (capsule) {
						Vue.prototype.CustomBar = capsule;
						// Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
						CustomBarHeight = capsule.bottom + (capsule.top - res.statusBarHeight) * 2;
					} else {
						CustomBarHeight = res.statusBarHeight + 50;
					}
					// #endif

					//支付宝
					// #ifdef MP-ALIPAY
					CustomBarHeight = res.statusBarHeight + res.titleBarHeight;
					// #endif

					//状态栏高度
					Vue.prototype.StatusBarHeight = res.statusBarHeight;
					Vue.prototype.CustomBarHeight = CustomBarHeight;
					Vue.prototype.TabbarHeight = 55;
					//页面内容高度
					Vue.prototype.PageHeight = res.screenHeight - CustomBarHeight;
					
					// console.log("CustomBarHeight",CustomBarHeight)
				}
			})


		},
		onShow: function() {

		},
		onHide: function() {

		}
	}
</script>

<style lang="scss">
	@import '~@/static/styles/app.scss';
	@import '~@/static/styles/iconfont.css';
</style>
